package com.example.define;

/**
 * 目标：掌握数组的遍历
 */
public class ArrayDemo3 {
    public static void main(String[] args) {
        int[] ages = {12, 24, 36};
        //            0   1    2

        // System.out.println(ages[0]);
        // System.out.println(ages[1]);
        // System.out.println(ages[2]);

        // 遍历数组
        for (int i = 0; i < ages.length; i++) {
            // i = 0 1 2
            System.out.println(ages[i]);
        }
    }
}
